Questions about Memory

Category: Geeks r Us

Post 1 by Eleni21 (I have proven to myself and the world that I need mental help) on Friday, 15-Jan-2010 18:12:42

Okay. I know that I could look this up, but want an answer to all of this at once and one that I could understand, because the ones I've seen get really complicated. What is the difference between expanded and extended memory, ram and rom and high and low memory? I know that rom is read only memory, so you can't access it. Is that like the flash memory on the Braille Lite? I've heard that some programs run from ram, but how can that be when they're installed to the hard drive and work from inside a directory? I know that some programs are memory hogs and so it's best to load them into high memory but how is this done? I've seen hymen, I think in autoexec.bat, but what if I don't want to start the program when the computer boots? I've also heard of ram drives, that are supposed to make programs run faster and more efficiently. But they disappear as soon as you turn off the machine. How do I create one? What is a tsr and from where does it load? My understanding is that it can run in the background while other programs are running. So I'm assuming then that a screen reader would be one. What, exactly, is the 640k barrier? From what I understand, it has to do with running a number of memory-hungry programs at once, though it's been breeched in more recent times. How do I check the amount of memory that is currently being used or that a program will use once loaded? Is that what a memory manager does?

Post 2 by theJournalist (move over school!) on Friday, 15-Jan-2010 19:26:12

wo. Ok. I don't even know where to start with all that, but here goes.
regarding extended and expanded memory, as well as the 640 k barrier you speak of.
Back in teh good ole days of Dos, there was a program called em386, made by microsoft. This was mainly used in Windows, but I believe with the start of windows 9x em386 began going to the dumps.
Em386 was a memory utility. It allowed the creation of EXPANDED memory, that is, for you to go over 640k, usually in IBM pcs, 384 kb extra to the already 640k conventional memory. So, the 640k you speak of is called conventional memory, because it is already there when starting ms-dos.

Extended memory is a similar thing. Again, it is related to expanded memory, in that the above mentioned em386 could make use of over 1 mb of ram on systems. So:
Expanded memory=allowed most 286/386 systems to go from 640k to 1 mb of ram, by using the additional 384 kb of ram in these systems.
extended memory=further improved upon expanded memory by allowing the use of (or if you want to say it technically, the ADDRESSING of) over 1 mb of ram.
On 286 systems, em386 could use the expanded 384k memory, while on 486 CPUs, it could in addition use the extended memory (typically creating over 1 mb of ms-dos memory)

Hope this is not too confusing. I understand it...

I'm not too sure on high memory, other than the fact that some programs require that it be loaded in high-memory. You would usually do this by loading it into config.sys, sometimes with the /high option.
no. You check the amount of ram available by using the mem command in dos. Not sure if that exists in dr-dos, but I know under dos mem could do this. Use mem /c /p to see current memory usage.

Ramdisks, also known as ram drives, were useful for those who wanted a temporary drive. As you've said, it does go away after you reset the system.
For example, the Windows 98 startup disk includes a ramdisk.sys program which creates a ram drive (not sure on it's size, but it prob wasn't more than 1 mb). Then, the floppy copies certain files onto this ram disk in order to lessen drive usage and speed up certain tasks.
Ramdrive.sys is still usable in dos, and it is loaded into config.sys with parameters defining the size of the disk in KB. Upon it's load, it will create an additional drive which needs to be formatted and can be treated just as any other drive.
I'm assuming that in dos, ram drives were very useful if the hard disk in a computer was shot: If you had, let's say, 4 megs of ram, you could allocate some portion of that 4 mb to use as a drive.

TSR. Stands for terminant-stay-resident. This basically means that until the program is terminated, it will run. This could yes, be a screen reader, but also a virus which plays yankee doodle at 4 each afternoon - it loads and stays TSR. Similar to a background application running in Windows.
Gosh. Roms. You know, only your bios uses a rom. It is in deed read-only memory, you generally can't access it.

Memory managers were just that, memory managers. See smartDrive.
Smartdrive was one such memory manager. It basically cashed frequently used hard-drive data in ram. Let's say you kept running a program over and over, or that a program kept accessing a particular resource like a dll.
SmartDrive stored chunks of that file so that the computer didn't have to load all of those files from the disk always.

Any of that help? Feel free to ask further questions.

All the best,
Tomi

Post 3 by Eleni21 (I have proven to myself and the world that I need mental help) on Friday, 15-Jan-2010 19:48:58

Wow! that was totally awesome! So basically, the higher the processor, the higher the memory available for ram. Extended memory, then, is an addition to expanded and that's how you get to that 1mb. Now I've seen systems with more than 1mb of ram. How does that work? Do all machines with higher processors have the m386 utility or was it eventually built into the os or something? That program would be called a memory extender right? I know there are others out there too but never understood their function till now. Thanks for clearing that up. It was obviously config.sys that I saw then, not autoexec.bat. So now I understand another function of that file. I never really knew too much about it and didn't want to play with it, since it could completely screw up my system if I mess it up. Grrr Humanware! I could've sworn there was a mem command, but since they stripped down the version of MS-DOS 6.21 in that machine, many things like tree, edit, defray and mem aren't available. I'm pretty sure that yes, DR-DOS does have a mem command or an equivalent and very suffisticated memory tools built right into the os as well.

Ooh, I wanna play with a ramdrive now. they sound like loads of fun. So basically, it's a virtual temporary partition of the currently existing drive? Can I load another version of DOS, or another screen reader into it? Too bad there's no standby mode in DOS, or I might be able to load some stuff from a cf card or floppy to use in this virtual drive on a machine, like the PC110, with no hard disk. Speaking of screen readers, how do I get mine to unload so that I can try some others, or do I need to edit the autoexec.bat file so it won't start when I boot the computer?

Ah, now I know how that alarm clock by Jim Kitchen works. It's a tsp! *smile* So if I'm running a task switcher, do the suspended task then become tars? What about a true multitasker?

I'll definitely look up SmartDrive, Qem and another one that I forget but that I know is definitely accessible. The idea of memory managers, sound really cool. I mean, my machine is lightening fast as it is, but I see no harm in helping it along. I thought dlls are only found in Windows.

Post 4 by Eleni21 (I have proven to myself and the world that I need mental help) on Sunday, 04-Apr-2010 14:04:25

since my first questions were answered so clearly, I figured I'd try another. according to the DOS Fallacies page, "There have been memory extenders around for over a decade. They allow DOS applications to access gigabytes of memory, although for most users, 64 Mb will run 10 or 15 applications easily because DOS programs are so much smaller than their GUI equivalents." That said, while I'd prefer a laptop with at least 64mb of ram, could I get away with 48, 40 or even 32mb? I've seen laptops with those amounts far more frequently than 64mb. I just don't want to shoot myself in the foot when it comes time for multitasking. But I probably won't run more than five programs at once, usually about three or four.

Post 5 by sorressean (Zone BBS Addict) on Sunday, 04-Apr-2010 19:35:13

Here's my quick response:

Low memory (the 640 k barrier), is where the bios puts a lot of it's data. For example: In my OS/kernel I'm writing, my kernel gets loaded into this bit of memory, and this is also where the video memory and others are. It's not part of dos, it's part of the bios and how things are handled. There are also memory holes, but that's another topic altogether.

As for ram, when you load a program it requests memory from the OS, which reserves that memory. That can be paged out later, but basically the program can sit in ram and run. This is a lot faster, because ram can be accessed faster than a harddrive. When you start paging, memory is taken from ram and written to a file (called a swap file). This allows for you to use more memory than you have, and the bits of your memory that your not using can be written to this file. When you need it, the MM can request that chunk, and it is mapped to a frame or frames.

As for the rest of the dos stuff, it's ancient and I've had no use for it, so... good luck there.

Post 6 by Eleni21 (I have proven to myself and the world that I need mental help) on Sunday, 04-Apr-2010 20:02:53

Memory holes? Is that one of the reasons for defrag or is that simply related to the physical hard disk? I read that, with flash cards and such, defrag isn't really that necessary because there are no moving parts. Anyway, I think I just got offtopic too. But I do need to know the minimum amount of ram that I can have without my machine being unbearably slow. I actually need to upgrade my IBM X32 to 2gb next month too because 512mb and XP get along but not harmoniously if you know what I mean.

Post 7 by sorressean (Zone BBS Addict) on Monday, 05-Apr-2010 19:20:19

No, there is a hole in physical memory, above the 2g limit, and there is one below I think, I'm not sure if it's still there. Anyway, it has nothing to do with defrag, and most users don't care/need to know about it, but it does come into play with OS development..

Basically, with defratmentation: your harddrive is a set of two disks, with a head moving back and forth. It's magnetic, so the drive spins, and the head moves from the center to the outside as it's spinning. What ends up happening is sometimes you get spaces where files won't fit, or files are split up, so the defragmenter can take those files and cluster them together, so that the drive doesn't have to make multiple rotations in order for you to access bits of data, it should all be contiguous.

Post 8 by Eleni21 (I have proven to myself and the world that I need mental help) on Saturday, 10-Jul-2010 0:36:11

It's been awhile since I've visited this thread. But now that I've gotten to use a tsr, aside from my screen reader, I'm wondering could a program that's originally a nontsr be made into one? And how do we get from that 1mb of ram, offered from extended memory, to 64mb? Why was it that DOS couldn't recognise more than that, and though I know most of you haven't used newer versions, how do you think the developers were able to overcome that challenge?